package sg.edu.nus.dashboard.stat.control.business
{
	import com.adobe.cairngorm.business.ServiceLocator;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.rpc.remoting.RemoteObject;
	
	public class GetStatDelegate
	{
		private var ire:IResponder = null;
		private var remoteObject:RemoteObject = null;
		
		public function GetStatDelegate(ire:IResponder):void
		{
			this.ire = ire;
			this.remoteObject = ServiceLocator.getInstance().getRemoteObject("databaseStatService");
		}
		
		public function getStatByName(paraName:String, fromTime:Date, toTime:Date):void
		{
			var asy:AsyncToken = remoteObject.getStatByName(paraName, fromTime, toTime);
			asy.addResponder(ire);
		}
	}
}